jun.SalestransDetailsstore = Ext.extend(Ext.data.JsonStore, {
    constructor: function (cfg) {
        cfg = cfg || {};
        jun.SalestransDetailsstore.superclass.constructor.call(this, Ext.apply({
            storeId: 'SalestransDetailsStoreId',
            url: 'SalestransDetails',
            autoLoad: !1,
            autoSave: !1,
            root: 'results',
            totalProperty: 'total',
            fields: [
                {name: 'salestrans_details'},
                {name: 'barang_id'},
                {name: 'salestrans_id'},
                {name: 'qty', type: 'float'},
                {name: 'beauty_id'},
                {name: 'disc', type: 'float'},
                {name: 'discrp', type: 'float'},
                {name: 'ketpot'},
                {name: 'vat', type: 'float'},
                {name: 'vatrp', type: 'float'},
                {name: 'beauty_tip', type: 'float'},
                {name: 'bruto', type: 'float'},
                {name: 'total', type: 'float'},
                {name: 'total_pot', type: 'float'},
                {name: 'price', type: 'float'}
            ]
        }, cfg));
        this.on('add', this.refreshData, this);
        this.on('update', this.refreshData, this);
        this.on('remove', this.refreshData, this);
    },
    refreshData: function (a) {
        var subtotal = this.sum("total");
        var vatrp = this.sum("vatrp");
        var discrp = parseFloat(Ext.getCmp("discrpid").getValue());
        Ext.getCmp("subtotalid").setValue(subtotal);
        Ext.getCmp("vatid").setValue(vatrp);
        var total = subtotal - vatrp - discrp;
        Ext.getCmp("totalid").setValue(total);
    }
});
jun.rztSalestransDetails = new jun.SalestransDetailsstore();
//jun.rztSalestransDetails.load();
